/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package autodiaryserver;

/**
 *
 * @author thang
 */
public class DSMS {
    private static final String FUNC_BUFFER = "buffer";
    private static final String FUNC_SIMPLE_ACT_TO_WINDOW = "simpleActToWindow";
    private static final String FUNC_STORE_COMPLEX_ACT = "storeComplexAct";

    /*
     * agrs[0]: which action
     * agrs[1]: parameter 1
     * agrs[2]: parameter 2
     */
    public static void main(String[] agrs){
        
        ConnectionManager.connectDb();

        // which function to be called
        if( agrs[0].trim().equalsIgnoreCase("buffer") ){
            int count = 0;            
            count = DataPackager.fillBuffer(1, Integer.parseInt(agrs[1]), Integer.parseInt(agrs[2]), 1);
            System.out.println("Buffered " + count + " records.");
        }

        if( agrs[0].trim().equalsIgnoreCase(FUNC_SIMPLE_ACT_TO_WINDOW) ){
            reasoner.WindowReasoner.putActToWindow();
        }
        
        if( agrs[0].trim().equalsIgnoreCase(FUNC_STORE_COMPLEX_ACT) ){
            
        }

        ConnectionManager.disconnectDb();
    }
    
}
